// background.js 通常最外层使用监听事件chrome.runtime.onInstalled.addListener(()=>{})
// 初始化插件，监听插件安装成功后，会触发对应的逻辑开始工作
chrome.runtime.onInstalled.addListener(function(){
	chrome.notifications.create(null, {
        type: 'basic',
        iconUrl: 'assets/img/flower-128.png',
        title: 'From My NewTab',
        message: 'Welcome to my custom extension!'
    });
    // chrome.browserAction.setBadgeText({text: 'tab'})
    // chrome.browserAction.setBadgeBackgroundColor({color: [65, 132, 243, 255]})
    chrome.contextMenus.create({
        title: "My NewTab",
        // contexts: ['selection'],
        // onclick: function(params) {
        //     chrome.tabs.create({url: 'https://www.baidu.com/s?ie=utf-8&wd=' + encodeURI(params.selectionText)})
        // }
        contexts: ['page'],
        onclick: function () {alert('Welcome to my custom extension!')}
    });
});




